home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-29 | 40.0 KB | 1,291 lines |
- Newsgroups: comp.sources.misc
- From: dvadura@plg.waterloo.edu (Dennis Vadura)
- Subject: v27i114: dmake - dmake Version 3.8, Part13/41
- Message-ID: <1992Jan28.031558.7569@sparky.imd.sterling.com>
- X-Md4-Signature: 8cf1e2a7623414996c3b19f5ac4390c3
- Date: Tue, 28 Jan 1992 03:15:58 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
- Posting-number: Volume 27, Issue 114
- Archive-name: dmake/part13
- Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
- Supersedes: dmake: Volume 19, Issue 22-58
-
- ---- Cut Here and feed the following to sh ----
- # this is dmake.shar.13 (part 13 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file dmake/make.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 13; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test -f _shar_wnt_.tmp; then
- sed 's/^X//' << 'SHAR_EOF' >> 'dmake/make.c' &&
- X }
- X }
- X
- X tcp->ce_flag |= F_VISITED;
- X
- X /* Note: If the prerequisite was made using a .SETDIR= attribute
- X * directory then we will include the directory in the fname
- X * of the target. */
- X if( push ) {
- X char *dir = nsetdirroot ? nsetdirroot->ce_dir : Makedir;
- X char *nname = Build_path(_prefix(dir,tcp->ce_dir), tcp->ce_fname);
- X
- X if( (tcp->ce_attr & A_FFNAME) && (tcp->ce_fname != NIL(char)) )
- X FREE( tcp->ce_fname );
- X
- X tcp->ce_fname = _strdup(nname);
- X tcp->ce_attr |= A_FFNAME;
- X }
- X
- X tcp = tcp->ce_all;
- X }
- X while( tcp != NIL(CELL) && tcp != cp );
- X
- stop_making_it:
- X _drop_mac( m_g );
- X _drop_mac( m_q );
- X _drop_mac( m_b );
- X _drop_mac( m_l );
- X _drop_mac( m_bb );
- X _drop_mac( m_up );
- X _drop_mac( m_at );
- X
- X while( push-- ) Pop_dir(FALSE);
- X
- X if( inf != NIL(char) ) FREE( inf );
- X if( all != NIL(char) ) FREE( all );
- X if( imm != NIL(char) ) FREE( imm );
- X if( outall != NIL(char) ) FREE( outall );
- X
- X DB_PRINT( "mem", ("%s:-< mem %ld", cp->CE_NAME, (long) coreleft()) );
- X DB_RETURN( rval );
- }
- X
- X
- static char *
- _prefix( pfx, pat )
- char *pfx;
- char *pat;
- {
- X char *opat = pat;
- X while( *pfx && *pat && *pfx++ == *pat++ );
- X
- X return( !*pfx ? _strspn(pat,DirBrkStr) : opat );
- }
- X
- X
- static LINKPTR
- _dup_prq( lp )
- LINKPTR lp;
- {
- X LINKPTR tlp;
- X
- X if( lp == NIL(LINK) ) return(lp);
- X
- X TALLOC(tlp, 1, LINK);
- X *tlp = *lp;
- X tlp->cl_next = _dup_prq( lp->cl_next );
- X
- X return(tlp);
- }
- X
- X
- static void
- _drop_mac( hp )/*
- ================ set a macro value to zero. */
- HASHPTR hp;
- {
- X if( hp && hp->ht_value != NIL(char) ) {
- X FREE( hp->ht_value );
- X hp->ht_value = NIL(char);
- X }
- }
- X
- X
- X
- int
- _explode_graph( cp, parent, setdirroot )/*
- ==========================================
- X Check to see if we have made the node already. If so then don't do
- X it again, except if the cell's ce_setdir field is set to something other
- X than the value of setdirroot. If they differ then, and we have made it
- X already, then make it again and set the cell's stat bit to off so that
- X we do the stat again. */
- CELLPTR cp;
- LINKPTR parent;
- CELLPTR setdirroot;
- {
- X /* we may return if we made it already from the same setdir location,
- X * or if it is not a library member whose lib field is non NULL. (if
- X * it is such a member then we have a line of the form:
- X * lib1 lib2 .LIBRARY : member_list...
- X * and we have to make sure all members are up to date in both libs. */
- X
- X if( cp->ce_setdir == setdirroot &&
- X !((cp->ce_attr & A_LIBRARYM) && (cp->ce_lib != NIL(char))) )
- X return( 0 );
- X
- X /* We check to make sure that we are comming from a truly different
- X * directory, ie. ".SETDIR=joe : a.c b.c d.c" are all assumed to come
- X * from the same directory, even though setdirroot is different when
- X * making dependents of each of these targets. */
- X
- X if( cp->ce_setdir != NIL(CELL) &&
- X setdirroot != NIL(CELL) &&
- X cp->ce_dir &&
- X setdirroot->ce_dir &&
- X !strcmp(cp->ce_dir, setdirroot->ce_dir) )
- X return( 0 );
- X
- X if( Max_proc > 1 ) {
- X if( parent == NIL(LINK) )
- X Fatal( "Internal Error: NIL parent in Make()" );
- X
- X TALLOC(parent->cl_prq, 1, CELL);
- X *parent->cl_prq = *cp;
- X cp = parent->cl_prq;
- X cp->ce_prq = _dup_prq(cp->ce_prq);
- X }
- X cp->ce_flag &= ~(F_STAT|F_VISITED|F_MADE);
- X
- X /* Indicate that we exploded the graph and that the current node should
- X * be made. */
- X return(1);
- }
- X
- X
- X
- PUBLIC int
- Exec_commands( cp )/*
- =====================
- X Execute the commands one at a time that are pointed to by the rules pointer
- X of the target cp. If a group is indicated, then the ce_attr determines
- X .IGNORE and .SILENT treatment for the group.
- X
- X The function returns 0, if the command is executed and has successfully
- X returned, and returns 1 if the command is executing but has not yet
- X returned (for parallel makes).
- X
- X The F_MADE bit in the cell is guaranteed set when the command has
- X successfully completed. */
- CELLPTR cp;
- {
- X static HASHPTR useshell = NIL(HASH);
- X static HASHPTR command = NIL(HASH);
- X static int read_cmnd = 0;
- X register STRINGPTR rp;
- X STRINGPTR orp;
- X char *cmnd;
- X char *groupfile;
- X FILE *tmpfile;
- X int do_it;
- X t_attr attr;
- X int group;
- X int trace;
- X int rval = 0;
- X
- X DB_ENTER( "Exec_commands" );
- X
- X attr = Glob_attr | cp->ce_attr;
- X trace = Trace || !(attr & A_SILENT);
- X group = cp->ce_flag & F_GROUP;
- X
- X /* Do it again here for those that call us from places other than Make()
- X * above. */
- X orp = _recipes[ RP_RECIPE ];
- X _recipes[ RP_RECIPE ] = cp->ce_recipe;
- X
- X if( group ) {
- X /* Leave this assignment of Current_target here. It is needed just
- X * incase the user hits ^C after the tempfile for the group recipe
- X * has been opened. */
- X Current_target = cp;
- X trace = Trace || !(attr & A_SILENT);
- X
- X if( !Trace ) tmpfile = Start_temp( Grp_suff, cp, &groupfile );
- X if( trace ) fputs( "[\n", stdout );
- X
- X /* Emit group prolog */
- X if( attr & A_PROLOG )
- X _append_file( _recipes[RP_GPPROLOG], tmpfile, cp->CE_NAME, trace );
- X }
- X
- X if( !useshell ) useshell=Def_macro("USESHELL",NIL(char),M_MULTI|M_EXPANDED);
- X if( !read_cmnd ) {command = GET_MACRO("COMMAND"); read_cmnd = 1;}
- X
- X /* Process commands in recipe. If in group, merely append to file.
- X * Otherwise, run them. */
- X for( rp = _recipes[RP_RECIPE]; rp != NIL(STRING); rp=rp->st_next,FREE(cmnd)){
- X t_attr a_attr = A_DEFAULT;
- X t_attr l_attr;
- X char *p;
- X int new_attr = FALSE;
- X int shell;
- X
- X /* Reset it for each recipe line otherwise tempfiles don't get removed.
- X * Since processing of $(mktmp ...) depends on Current_target being
- X * correctly set. */
- X Current_target = cp;
- X
- X /* Only check for +,-,%,@ if the recipe line begins with a '$' macro
- X * expansion. Otherwise there is no way it is going to find these
- X * now. */
- X if( *rp->st_string == '$' && !group ) {
- X t_attr s_attr = Glob_attr;
- X Glob_attr |= A_SILENT;
- X Suppress_temp_file = TRUE;
- X cmnd = Expand(rp->st_string);
- X Suppress_temp_file = FALSE;
- X a_attr |= Rcp_attribute(cmnd);
- X FREE(cmnd);
- X ++new_attr;
- X Glob_attr = s_attr;
- X }
- X
- X l_attr = attr|a_attr|rp->st_attr;
- X shell = ((l_attr & A_SHELL) != 0);
- X useshell->ht_value = (group||shell)?"yes":"no";
- X
- X cmnd = Expand( rp->st_string );
- X
- X if( new_attr ) {
- X char *ecmnd = cmnd;
- X cmnd = _strdup(_strspn(cmnd, " \t\n+-@%"));
- X FREE(ecmnd);
- X }
- X
- X /* COMMAND macro is set to "$(CMNDNAME) $(CMNDARGS)" by default, it is
- X * possible for the user to reset it to, for example
- X * COMMAND = $(CMNDNAME) @$(mktmp $(CMNDARGS))
- X * in order to get a different interface for his command execution. */
- X if( command != NIL(HASH) && !group && *(p = _strpbrk(cmnd, " \t\n")) ) {
- X char *cname = cmnd;
- X
- X *p = '\0';
- X (void) Def_macro("CMNDNAME",cname,M_MULTI|M_EXPANDED);
- X (void) Def_macro("CMNDARGS",p+1,M_MULTI|M_EXPANDED);
- X
- X cmnd = Expand("$(COMMAND)");
- X FREE(cname); /* cname == cmnd at this point. */
- X }
- X
- X Swap_on_exec = ((l_attr & A_SWAP) != 0); /* Swapping for DOS only */
- X do_it = !Trace;
- X
- X if( !group && Trace && _strstr(rp->st_string,"$(MAKE)") ) {
- X Wait_for_completion |= Trace;
- X do_it = TRUE;
- X }
- X
- X if( group )
- X Append_line( cmnd, TRUE, tmpfile, cp->CE_NAME, trace, 0 );
- X else {
- X if( *_strspn(cmnd, " \t") != '\0' )
- X Print_cmnd(cmnd, !(do_it && (l_attr & A_SILENT)), 0);
- X else
- X do_it = FALSE;
- X
- X rval=Do_cmnd(cmnd,FALSE,do_it,cp,(l_attr&A_IGNORE)!=0, shell,
- X rp->st_next == NIL(STRING) );
- X }
- X }
- X
- X /* If it is a group then output the EPILOG if required and possibly
- X * execute the command */
- X if( group ) {
- X if( attr & A_EPILOG ) /* emit epilog */
- X _append_file( _recipes[RP_GPEPILOG], tmpfile, cp->CE_NAME, trace );
- X
- X if( trace ) fputs("]\n", stdout);
- X
- X if( do_it = !Trace ) Close_temp( cp, tmpfile );
- X rval = Do_cmnd(groupfile, TRUE, do_it, cp, (attr & A_IGNORE)!=0,
- X TRUE, TRUE);
- X }
- X
- X Wait_for_completion = FALSE;
- X _recipes[ RP_RECIPE ] = orp;
- X DB_RETURN( rval );
- }
- X
- X
- PUBLIC void
- Print_cmnd( cmnd, echo, map )/*
- ================================
- X This routine is called to print out the command to stdout. If echo is
- X false the printing to stdout is supressed, but the new lines in the command
- X are still deleted. */
- char *cmnd;
- int echo;
- int map;
- {
- X register char *p;
- X register char *n;
- X char tmp[3];
- X
- X DB_ENTER( "Print_cmnd" );
- X
- X if( echo ) {
- X printf( "%s\n", cmnd );
- X fflush(stdout);
- X }
- X
- X tmp[0] = ESCAPE_CHAR;
- X tmp[1] = CONTINUATION_CHAR;
- X tmp[2] = '\0';
- X
- X for( p=cmnd; *(n = _strpbrk(p,tmp)) != '\0'; )
- X if(*n == CONTINUATION_CHAR && n[1] == '\n') {
- X DB_PRINT( "make", ("fixing [%s]", p) );
- X strcpy( n, n+2 );
- X p = n;
- X }
- X else {
- X if( *n == ESCAPE_CHAR && map ) Map_esc( n );
- X p = n+1;
- X }
- X
- X DB_VOID_RETURN;
- }
- X
- X
- X
- /* These routines are used to maintain a stack of directories when making
- X * the targets. If a target cd's to the directory then it is assumed that
- X * it will undo it when it is finished making itself. */
- X
- static STRINGPTR dir_stack = NIL(STRING);
- X
- int
- Push_dir( dir, name, ignore )/*
- ===============================
- X Change the current working directory to dir and save the current
- X working directory on the stack so that we can come back.
- X
- X If ignore is TRUE then do not complain about _ch_dir if not possible.*/
- char *dir;
- char *name;
- int ignore;
- {
- X STRINGPTR new_dir;
- X
- X DB_ENTER( "Push_dir" );
- X
- X if( dir == NIL(char) || *dir == '\0' ) dir = Pwd;
- X if( *dir == '\'' && dir[strlen(dir)-1] == '\'' ) {
- X dir = _strdup(dir+1);
- X dir[strlen(dir)-1]='\0';
- X }
- X else
- X dir = Expand(dir);
- X
- X if( Set_dir(dir) ) {
- X if( !ignore )
- X Fatal( "Unable to change to directory `%s', target is [%s]",
- X dir, name );
- X FREE(dir);
- X DB_RETURN( 0 );
- X }
- X
- X DB_PRINT( "dir", ("Push: [%s]", dir) );
- X if( Verbose & V_PRINT_DIR )
- X printf( "%s: Changed to directory [%s]\n", Pname, dir );
- X
- X FREE( dir );
- X TALLOC( new_dir, 1, STRING );
- X new_dir->st_next = dir_stack;
- X dir_stack = new_dir;
- X new_dir->st_string = _strdup( Pwd );
- X
- X Def_macro( "PWD", Get_current_dir(), M_MULTI | M_EXPANDED );
- X _set_tmd();
- X
- X DB_RETURN( 1 );
- }
- X
- X
- X
- PUBLIC void
- Pop_dir(ignore)/*
- =================
- X Change the current working directory to the previous saved dir. */
- int ignore;
- {
- X STRINGPTR old_dir;
- X char *dir;
- X
- X DB_ENTER( "Pop_dir" );
- X
- X if( dir_stack == NIL(STRING) )
- X if( ignore ) {
- X DB_VOID_RETURN;
- X }
- X else
- X Error( "Directory stack empty for return from .SETDIR" );
- X
- X if( Set_dir(dir = dir_stack->st_string) )
- X Fatal( "Could not change to directory `%s'", dir );
- X
- X Def_macro( "PWD", dir, M_MULTI | M_EXPANDED );
- X DB_PRINT( "dir", ("Pop: [%s]", dir) );
- X if( Verbose & V_PRINT_DIR )
- X printf( "%s: Changed back to directory [%s]\n", Pname, dir);
- X
- X old_dir = dir_stack;
- X dir_stack = dir_stack->st_next;
- X
- X FREE( old_dir->st_string );
- X FREE( old_dir );
- X _set_tmd();
- X
- X DB_VOID_RETURN;
- }
- X
- X
- X
- static void
- _set_tmd()/*
- ============
- X Set the TWD Macro */
- {
- X TKSTR md, pd;
- X char *m, *p;
- X char *tmd;
- X int is_sep;
- X int first = 1;
- X
- X SET_TOKEN( &md, Makedir );
- X SET_TOKEN( &pd, Pwd );
- X
- X m = Get_token( &md, DirBrkStr, FALSE );
- X (void) Get_token( &pd, DirBrkStr, FALSE );
- X is_sep = (strchr(DirBrkStr, *m) != NIL(char));
- X tmd = _strdup( "" );
- X
- X do {
- X m = Get_token( &md, DirBrkStr, FALSE );
- X p = Get_token( &pd, DirBrkStr, FALSE );
- X
- X if( !is_sep && strcmp(m, p) ) { /* they differ */
- X char *tmp;
- X if( first ) { /* They differ in the first component */
- X tmd = Makedir; /* In this case use the full path */
- X break;
- X }
- X
- X if( *p ) tmp = Build_path( "..", tmd );
- X if( *m ) tmp = Build_path( tmd, m );
- X FREE( tmd );
- X tmd = _strdup( tmp );
- X }
- X
- X is_sep = 1-is_sep;
- X first = 0;
- X } while (*m || *p);
- X
- X CLEAR_TOKEN( &md );
- X CLEAR_TOKEN( &pd );
- X
- X Def_macro( "TMD", tmd, M_MULTI | M_EXPANDED );
- X if( tmd != Makedir ) FREE( tmd );
- }
- X
- X
- static void
- _set_recipe( target, ind )/*
- ============================
- X Set up the _recipes static variable so that the slot passed in points
- X at the rules corresponding to the target supplied. */
- char *target;
- int ind;
- {
- X CELLPTR cp;
- X HASHPTR hp;
- X
- X if( (hp = Get_name(target, Defs, FALSE)) != NIL(HASH) ) {
- X cp = hp->CP_OWNR;
- X _recipes[ ind ] = cp->ce_recipe;
- X }
- X else
- X _recipes[ ind ] = NIL(STRING);
- }
- X
- X
- X
- PUBLIC void
- Append_line( cmnd, newline, tmpfile, name, printit, map )
- char *cmnd;
- int newline;
- FILE *tmpfile;
- char *name;
- int printit;
- int map;
- {
- X Print_cmnd( cmnd, printit, map );
- X
- X if( Trace ) return;
- X
- X fputs(cmnd, tmpfile);
- X if( newline ) fputc('\n', tmpfile);
- X fflush(tmpfile);
- X
- X if( ferror(tmpfile) )
- X Fatal("Write error on temporary file, while processing `%s'", name);
- }
- X
- X
- X
- static void
- _append_file( rp, tmpfile, name, printit )
- register STRINGPTR rp;
- FILE *tmpfile;
- char *name;
- int printit;
- {
- X char *cmnd;
- X
- X while( rp != NIL(STRING) ) {
- X Append_line(cmnd = Expand(rp->st_string), TRUE, tmpfile, name, printit,0);
- X FREE(cmnd);
- X rp = rp->st_next;
- X }
- }
- X
- X
- #define NUM_BUCKETS 20
- X
- typedef struct strpool {
- X char *string; /* a pointer to the string value */
- X uint32 keyval; /* the strings hash value */
- X struct strpool *next; /* hash table link pointer */
- } POOL, *POOLPTR;
- X
- static POOLPTR strings[ NUM_BUCKETS ];
- X
- static char *
- _pool_lookup( str )/*
- =====================
- X Scan down the list of chained strings and see if one of them matches
- X the string we are looking for. */
- char *str;
- {
- X register POOLPTR key;
- X uint32 keyval;
- X uint16 hv;
- X uint16 keyindex;
- X char *string;
- X
- X DB_ENTER( "_pool_lookup" );
- X
- X if( str == NIL(char) ) DB_RETURN("");
- X
- X hv = Hash(str, &keyval);
- X key = strings[ keyindex = (hv % NUM_BUCKETS) ];
- X
- X while( key != NIL(POOL) )
- X if( (key->keyval != keyval) || strcmp(str, key->string) )
- X key = key->next;
- X else
- X break;
- X
- X if( key == NIL(POOL) ) {
- X DB_PRINT( "pool", ("Adding string [%s]", str) );
- X TALLOC( key, 1, POOL ); /* not found so add string */
- X
- X key->string = string = _strdup(str);
- X key->keyval = keyval;
- X
- X key->next = strings[ keyindex ];
- X strings[ keyindex ] = key;
- X }
- X else {
- X DB_PRINT( "pool", ("Found string [%s], key->string") );
- X string = key->string;
- X }
- X
- X DB_RETURN( string );
- }
- SHAR_EOF
- chmod 0640 dmake/make.c ||
- echo 'restore of dmake/make.c failed'
- Wc_c="`wc -c < 'dmake/make.c'`"
- test 28699 -eq "$Wc_c" ||
- echo 'dmake/make.c: original size 28699, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/make.cmd ==============
- if test -f 'dmake/make.cmd' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/make.cmd (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/make.cmd' &&
- echo off
- cls
- rem *** This is the make command file that is used under OS/2 to make the
- rem *** first version of dmake. It isn't pretty but it does work, assuming
- rem *** the compilers have been correctly setup.
- rem
- echo Running make.cmd script to make a %1 copy of dmake.
- X
- if %0%1 == %0 goto error
- if %1 == msc40 goto mkmsc40
- if %1 == msc50 goto mkmsc50
- if %1 == msc51 goto mkmsc51
- if %1 == msc60 goto mkmsc60
- if %1 == ibm goto mkibm
- X
- rem label the possible DOS variations for dmake here.
- :error
- echo OS/2 INDEX: You must specify one of:
- echo ------------------
- echo msc40 - Microsoft C 4.0 compile.
- echo msc50 - Microsoft C 5.0 compile.
- echo msc51 - Microsoft C 5.1 compile.
- echo msc60 - Microsoft C 6.0 compile.
- 3cho ibm - IBM C 2.0 compile.
- goto end
- X
- rem This is the script that makes dmake using Microsoft C 4.0
- :mkmsc40
- os2\mscdos\mk40.cmd
- goto end
- X
- rem This is the script that makes dmake using Microsoft C 5.0
- :mkmsc50
- os2\mscdos\mk50.cmd
- goto end
- X
- rem This is the script that makes dmake using Microsoft C 5.1
- :mkmsc51
- os2\mscdos\mk51.cmd
- goto end
- X
- rem This is the script that makes dmake using Microsoft C 6.0
- :mkmsc60
- os2\mscdos\mk60.cmd
- goto end
- X
- rem This is the script that makes dmake using Microsoft C 6.0
- :ibm
- os2\ibm\mkc2.cmd
- goto end
- X
- rem All done!
- :end
- SHAR_EOF
- chmod 0640 dmake/make.cmd ||
- echo 'restore of dmake/make.cmd failed'
- Wc_c="`wc -c < 'dmake/make.cmd'`"
- test 1310 -eq "$Wc_c" ||
- echo 'dmake/make.cmd: original size 1310, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/makefile.mk ==============
- if test -f 'dmake/makefile.mk' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/makefile.mk (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/makefile.mk' &&
- # //// Makefile for DMAKE. \\\\
- # The target system is characterized by the following macros imported from
- # the environment.
- #
- # OS - gives the class of operating system
- # OSRELEASE - optionally gives the particular release of the OS above.
- # OSENVIRONMENT - optionally gives the environment under which the above
- # OS is in use.
- #
- # For valid values for the above macros consult the readme/* files or type
- # 'make' by itself to get a summary of what is available.
- X
- # First target in the makefile, do this so that targets declared in the
- # included files are never marked as being the first *default* target.
- first : all ;
- X
- #Enable keeping of state for future compiles
- .KEEP_STATE := _state.mk
- X
- # Pull in the configuration macros, from the environment. OS is required,
- # OSRELEASE, and OSENVIRONMENT are optional.
- .IF $(OS) == $(NULL)
- X .IMPORT : OS
- .END
- .IMPORT .IGNORE : OSRELEASE OSENVIRONMENT TMPDIR
- X
- # Define $(PUBLIC)
- _osenv := $(OSENVIRONMENT)$(DIRSEPSTR)
- _osre := $(OSRELEASE)$(DIRSEPSTR)$(!null,$(OSENVIRONMENT) $(_osenv))
- ENVDIR = $(OS)$(DIRSEPSTR)$(!null,$(OSRELEASE) $(_osre))
- PUBLIC = $(ENVDIR)public.h
- STARTUP := startup.mk
- X
- # Define the source files
- SRC =\
- X infer.c make.c stat.c expand.c dmstring.c hash.c dag.c dmake.c\
- X path.c imacs.c sysintf.c parse.c getinp.c quit.c state.c\
- X basename.c dmdump.c macparse.c rulparse.c percent.c function.c
- X
- # Common Include files.
- HDR = dmake.h extern.h struct.h vextern.h patchlvl.h version.h
- X
- # Define the TARGET we are making, and where the OBJECT files go.
- OBJDIR := objects
- TARGET = dmake$E
- CFLAGS += -I.
- X
- # Meta rule for making .o's from .c's (give our own so we can move object
- # to objects directory in a portable, compiler independent way)
- # Define it before the .INCLUDE so that different OS combinations can redefine
- # it.
- %$O : %.c
- .IF $(SHELL) == mpw
- X %$(CC) $(CFLAGS) -o :$(OBJDIR:s,/,:,):$@ $<
- .ELSE
- X %$(CC) -c $(CFLAGS) $<
- .IF $(SHELL) != $(COMSPEC)
- X mv $(@:f) $(OBJDIR)
- .ELSE
- X +copy $(@:f) $(OBJDIR)
- X +del $(@:f)
- .ENDIF
- .ENDIF
- X
- # Pull in the proper configuration files, based on the value of OS.
- .INCLUDE : $(OS)/config.mk
- .INCLUDE : dbug/dbug.mk
- X
- # Set the .SOURCE targets so that we look for things in the right place.
- .SOURCE.c :^ .NULL
- .SOURCE.h :^ .NULL
- .SOURCE$O :^ $(OBJDIR)
- .PRECIOUS : $(HDR)
- X
- # Must come after the above INCLUDE so that it gets ALL objects.
- OBJECTS := {$(ASRC:b) $(SRC:b)}$O
- X
- # The main target, make sure the objects directory exists first.
- # LDARGS is defined in config.mk file of each OS/OSRELEASE combination.
- all : $(TARGET) $(STARTUP);
- $(TARGET) : $(OBJDIR)
- $(TARGET) : $(OBJECTS);$(LD) $(LDARGS)
- .IF $(SHELL) == mpw
- $(STARTUP) : $(ENVDIR)$(STARTUP); duplicate :$(<:s,/,:,) $@
- .ELSE
- $(STARTUP) : $(ENVDIR)$(STARTUP); $(eq,$(SHELL),$(COMSPEC) +copy cp) $< $@
- .ENDIF
- X
- # how to make public.h
- public .PHONY : $(PUBLIC);
- $(PUBLIC) .SHELL .NOSTATE: $(SRC)
- X genpub -n DMAKE $< >$@
- X rcsclean $@ > /dev/null
- X
- # Other obvious targets...
- .IF $(SHELL) == mpw
- $(OBJDIR):;-newfolder $@
- .ELSE
- $(OBJDIR):;-$(eq,$(SHELL),$(COMSPEC) +md mkdir) $@
- .ENDIF
- X
- # remaining dependencies should be automatically generated
- sysintf$O : $(OS)/sysintf.h
- ruletab$O : $(OS)/startup.h #khc 01NOV90 - dependency was missing
- $(OBJECTS) : $(HDR)
- X
- clean:;+- $(RM) -rf dmake$E dbdmake$E objects* $(STARTUP) _*state*.mk
- X
- # Rules for making the manual pages.
- man .SETDIR=man : dmake.nc dmake.uue ;
- dmake.nc : dmake.p ; scriptfix < $< > $@
- dmake.p : dmake.tf; typeset -man -Tdumb $< > $@
- dmake.uue : dmake.p
- X compress -b 12 dmake.p
- X mv dmake.p.Z dmake.Z
- X uuencode dmake.Z dmake.Z >dmake.uue
- X /bin/rm -f dmake.Z
- X
- #--------------------------------------------------------------------------
- # Make the various archives for shipping the thing around.
- #
- archives : zoo tar shar;
- X
- zoo .PHONY : dmake.zoo ;
- shar .PHONY : dmake.shar;
- tar .PHONY : dmake.tar;
- X
- dmake.zoo : dir-copy
- [
- X find dmake -type f -print | zoo aI $@
- X $(RM) -rf src-list dmake
- ]
- X
- dmake.shar : dir-copy
- [
- X find dmake -type f -print >src-list
- X xshar -vc -o$@ -L40 `cat src-list`
- X $(RM) -rf src-list dmake
- ]
- X
- dmake.tar : dir-copy
- [
- X tar cf $@ dmake
- X $(RM) -rf src-list dmake
- ]
- X
- dir-copy .PHONY : src-list
- [
- X echo 'tmp.tar .SILENT :$$(ALLSRC) ;tar -cf tmp.tar $$(ALLSRC)' >> $<
- X $(MAKECMD) -f $< tmp.tar
- X mkdir dmake
- X cd dmake
- X tar xf ../tmp.tar; chmod -R u+rw .
- X cd ..
- X /bin/rm -f tmp.tar
- ]
- X
- src-list : clean man
- X echo 'ALLSRC = \' >$@
- X find . -type f -print |\
- X sed -e 's/RCS\///' -e 's/,v//' -e 's/$$/\\/' -e 's/^\.\// /'|\
- X sort -u |\
- X grep -v tst | grep -v $@ | grep -v LICENSE |\
- X grep -v '\.zoo' | grep -v '\.tar'| grep -v '\.shar' >> $@
- X echo ' LICENSE' >> $@
- X
- #--------------------------------------------------------------------------
- # This section can be used to make the necessary script files so that dmake
- # can be bootstrapped.
- #
- # dmake scripts -- makes all the script files at once.
- #
- SH_n = $(@:s/swp-/-/:s,-,/,:s/scripts/${SCRIPTFILE}/)
- MS_n = MAKESTARTUP=$(@:s/swp-/-/:s,-,/,:s/scripts/startup.mk/)
- SH = $(SH_n:s/c40d/cd/:s/c50d/cd/:s/c51d/cd/:s/c60d/cd/:s/ibmc2/ibm/)
- MS = $(MS_n:s/c40d/cd/:s/c50d/cd/:s/c51d/cd/:s/c60d/cd/:s/ibmc2/ibm/)
- FIX-SH = $(SH:s,fix/,,)
- X
- scripts: unix-scripts atari-tos-scripts msdos-scripts os2-scripts\
- X apple-mac-scripts
- X
- # To add a new environment for UNIX, simply create the appropriate entry
- # in the style below for the macro which contains the OS, OSRELEASE and
- # OSENVIRONMENT flags. Then add the entry as a recipe line for the target
- # unix-scripts.
- #
- unix-bsd43-scripts-flags = OS=unix OSRELEASE=bsd43 OSENVIRONMENT=
- unix-bsd43-uw-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=uw
- unix-bsd43-vf-scripts-flags= OS=unix OSRELEASE=bsd43 OSENVIRONMENT=vf
- unix-sysvr4-scripts-flags = OS=unix OSRELEASE=sysvr4 OSENVIRONMENT=
- unix-sysvr3-scripts-flags = OS=unix OSRELEASE=sysvr3 OSENVIRONMENT=
- unix-sysvr3-pwd-scripts-flags = OS=unix OSRELEASE=sysvr3 OSENVIRONMENT=pwd
- unix-xenix-scripts-flags = OS=unix OSRELEASE=xenix OSENVIRONMENT=
- unix-xenix-pwd-scripts-flags = OS=unix OSRELEASE=xenix OSENVIRONMENT=pwd
- unix-sysvr1-scripts-flags = OS=unix OSRELEASE=sysvr1 OSENVIRONMENT=
- unix-386ix-scripts-flags = OS=unix OSRELEASE=386ix OSENVIRONMENT=
- unix-coherent-scripts-flags= OS=unix OSRELEASE=coherent OSENVIRONMENT=
- tos--scripts-flags = OS=tos OSRELEASE= OSENVIRONMENT=
- mac--scripts-flags = OS=mac OSRELEASE= OSENVIRONMENT=
- X
- unix-scripts .SWAP : clean
- X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-uw-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-bsd43-vf-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-sysvr4-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-sysvr3-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-sysvr3-pwd-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-xenix-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-xenix-pwd-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-sysvr1-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-386ix-scripts
- X $(MAKE) SCRIPTFILE=make.sh unix-coherent-scripts
- X
- unix-%-scripts .SWAP :
- X $(MAKECMD) -s $($@-flags) .KEEP_STATE:= public
- X $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
- X
- tos-%-scripts .SWAP :
- X $(MAKECMD) -s $($@-flags) .KEEP_STATE:= public
- X $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
- X
- atari-tos-scripts .SWAP : clean
- X $(MAKE) SCRIPTFILE=make.sh tos--scripts
- X
- apple-mac-scripts .SWAP : clean
- X $(MAKE) SCRIPTFILE=make.sh mac--scripts
- X
- mac-%-scripts .SWAP :
- X $(MAKECMD) -s $($@-flags) .KEEP_STATE:= public
- X $(MAKECMD) -ns .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
- X sed 's/ mac\/\(.*\)$$/ :mac:\1/' <$(SH) >/tmp/t
- X /bin/mv /tmp/t $(SH)
- X
- # We make the standard dos scripts here, but we have to go and fix up the
- # mkXX.bat file since it contains names of temporary files for the response
- # files required by the linker. We need to also construct the response file
- # contents. These two functions are performed by the fix-msdos-%-scripts
- # meta-target.
- #
- # To add a new DOS environment just do what is described for adding a new
- # unix environment, and then make certain that the fix-msdos-%-scripts target
- # performs the correct function for the new environment.
- msdos-cf = OS=msdos OSENVIRONMENT=
- msdos-tccdos-scripts-flags = $(msdos-cf) OSRELEASE=tccdos SWAP=n
- msdos-tccdosswp-scripts-flags = $(msdos-cf) OSRELEASE=tccdos
- msdos-bccdos-scripts-flags = $(msdos-cf) OSRELEASE=bccdos SWAP=n
- msdos-bccdosswp-scripts-flags = $(msdos-cf) OSRELEASE=bccdos
- msdos-msc40dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=4.0
- msdos-msc40dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=4.0
- msdos-msc50dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.0
- msdos-msc50dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=5.0
- msdos-msc51dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.1
- msdos-msc51dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=5.1
- msdos-msc60dos-scripts-flags= $(msdos-cf) OSRELEASE=mscdos SWAP=n MSC_VER=6.0
- msdos-msc60dosswp-scripts-flags = $(msdos-cf) OSRELEASE=mscdos MSC_VER=6.0
- msdos-ztcdos-scripts-flags= $(msdos-cf) OSRELEASE=ztcdos SWAP=n
- msdos-ztcdosswp-scripts-flags= $(msdos-cf) OSRELEASE=ztcdos
- X
- msdos-scripts: clean\
- X msdos-tcc-scripts msdos-bcc-scripts\
- X msdos-msc-scripts msdos-ztc-scripts;
- X
- msdos-tcc-scripts .SWAP :
- X $(MAKE) SCRIPTFILE=mk.bat msdos-tccdos-scripts
- X $(MAKE) SCRIPTFILE=mkswp.bat msdos-tccdosswp-scripts
- X
- msdos-bcc-scripts .SWAP :
- X $(MAKE) SCRIPTFILE=mk.bat msdos-bccdos-scripts
- X $(MAKE) SCRIPTFILE=mkswp.bat msdos-bccdosswp-scripts
- X
- msdos-msc-scripts .SWAP :! 40 50 51 60
- X $(MAKE) SCRIPTFILE=mk$?.bat msdos-msc$?dos-scripts
- X $(MAKE) SCRIPTFILE=mk$?swp.bat msdos-msc$?dosswp-scripts
- X
- msdos-ztc-scripts .SWAP :
- X $(MAKE) SCRIPTFILE=mk.bat msdos-ztcdos-scripts
- X $(MAKE) SCRIPTFILE=mkswp.bat msdos-ztcdosswp-scripts
- X
- msdos-%-scripts .SWAP .SILENT:
- X $(MAKE) -s $($@-flags) .KEEP_STATE:= public
- X $(MAKE) -ns SHELL=command.com COMSPEC=command.com .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
- X $(MAKE) -s $(MAKEMACROS) $(MS) $($@-flags) fix-msdos-$*-scripts
- X
- X
- # We make the standard OS/2 scripts here, but we have to go and fix up the
- # mkXX.cmd file since it contains names of temporary files for the response
- # files required by the linker. We need to also construct the response file
- # contents. These two functions are performed by the fix-msdos-%-scripts
- # meta-target.
- #
- # To add a new OS/2 environment just do what is described for adding a new
- # unix environment, and then make certain that the fix-msdos-%-scripts target
- # performs the correct function for the new environment.
- os2-cf = OS=os2 OSENVIRONMENT=
- os2-msc40dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=4.0
- os2-msc50dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.0
- os2-msc51dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=5.1
- os2-msc60dos-scripts-flags= $(os2-cf) OSRELEASE=mscdos SWAP=n MSC_VER=6.0
- os2-ibmc2-scripts-flags= $(os2-cf) OSRELEASE=ibm SWAP=n MSC_VER=5.1
- X
- os2-scripts: clean os2-msc-scripts os2-ibm-scripts;
- X
- os2-msc-scripts .SWAP :! 40 50 51 60
- X $(MAKE) SCRIPTFILE=mk$?.cmd os2-msc$?dos-scripts
- X
- os2-ibm-scripts .SWAP :! c2
- X $(MAKE) SCRIPTFILE=mk$?.cmd os2-ibm$?-scripts
- X
- os2-%-scripts .SWAP :
- X $(MAKE) -s $($@-flags) .KEEP_STATE:= public
- X $(MAKE) -ns SHELL=cmd.exe COMSPEC=cmd.exe .KEEP_STATE:= $(MS) $($@-flags) >$(SH)
- X $(MAKE) -s $(MAKEMACROS) $(MS) $($@-flags) fix-os2-$*-scripts
- X
- # Signify NULL targets for the various MSC compiler versions.
- c2 40 50 51 60:;
- X
- # Go over the created script file and make sure all the '/' that are in
- # filenames are '\', and make sure the final link command line looks
- # reasonable.
- MAPOBJ = obj$(SWAP:s/y/swp/:s/n//).rsp
- MAPLIB = lib$(SWAP:s/y/swp/:s/n//).rsp
- OBJRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPOBJ},)
- LIBRSP = $(SH:s,fix/,,:s,${SCRIPTFILE},${MAPLIB},)
- DOSOBJ = $(CSTARTUP) $(OBJDIR)/{$(OBJECTS)}
- fix-%-scripts:
- X tail -r $(FIX-SH) >tmp-sh-r
- X tail +3 tmp-sh-r | sed -e 's,/,\\,g' >tmp-out
- X tail -r tmp-out >$(FIX-SH)
- X head -2 tmp-sh-r |\
- X sed -e 's,\\usr\\tmp\\mkA[a-zA-Z]*[0-9]*,$(OBJRSP),'\
- X -e 's,\\usr\\tmp\\mkB[a-zA-Z]*[0-9]*,$(LIBRSP),' |\
- X sed -e 's,$(OS)/,$(OS)\\,g'\
- X -e 's,$(OS)/$(OSRELEASE)/,$(OS)\\$(OSRELEASE)\\,g'\
- X -e 's,$(OS)\\$(OSRELEASE)/,$(OS)\\$(OSRELEASE)\\,g'\
- X -e 's,$(OS)/$(OSRELEASE)\\,$(OS)\\$(OSRELEASE)\\,g' >>$(FIX-SH)
- X rm -f tmp-sh-r tmp-out
- X mv <+$(DOSOBJ:s,/,\\,:t"+\n")\n+> $(OBJRSP)
- X mv <+$(LDLIBS:s,/,\\,:t"+\n")\n+> $(LIBRSP)
- SHAR_EOF
- chmod 0640 dmake/makefile.mk ||
- echo 'restore of dmake/makefile.mk failed'
- Wc_c="`wc -c < 'dmake/makefile.mk'`"
- test 12374 -eq "$Wc_c" ||
- echo 'dmake/makefile.mk: original size 12374, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/makefile ==============
- if test -f 'dmake/makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/makefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/makefile' &&
- # Default makefile for the various versions of dmake that we
- # have available. This is a bootstrap version and uses /bin/sh to
- # execute a script which compiles dmake.
- #
- # Note the DOS commands actually invoke command.com to run the .bat file
- # to make the script.
- X
- all :
- X @-echo ""; clear; exit 0
- X @echo "INDEX: You must specify 'make target' where target is one of:"
- X @echo "-------------"
- X @echo " make bsd43 - Generic BSD 4.3 System"
- X @echo " make bsd43uw - Generic BSD 4.3 at U of Waterloo"
- X @echo " make bsd43vf - Generic BSD 4.3 that needs vfprintf"
- X @echo " make sysvr4 - Generic SysV R4 UNIX System"
- X @echo " make sysvr3 - Generic SysV R3 UNIX System"
- X @echo " make sysvr3pwd - Generic SysV R3 UNIX System, our PWD"
- X @echo " make sysvr1 - Generic SysV R1 UNIX System"
- X @echo " make dynix - Sequent DYNIX System"
- X @echo " make ultrix - Ultrix 3.0 System"
- X @echo " make mips - Any MIPS System"
- X @echo " make coherent - Any Coherent System"
- X @echo " make 386ix - 386/ix (SysV R3) System"
- X @echo " make xenix - 386 Xenix System"
- X @echo " make xenixpwd - 386 Xenix System, our PWD"
- X @echo " make aix - IBM RS6000/AIX System"
- X @echo " make os2msc40 - OS/2 using MSC 4.0 compiler"
- X @echo " make os2msc50 - OS/2 using MSC 5.0 compiler"
- X @echo " make os2msc51 - OS/2 using MSC 5.1 compiler"
- X @echo " make os2msc60 - OS/2 using MSC 6.0 compiler"
- X @echo " make tos - Atari-ST TOS using GCC as compiler"
- X @echo " make tcc - DOS with Turbo C 2.0"
- X @echo " make bcc - DOS with Borland C++ 2.0"
- X @echo " make tccswp - swapping DOS version with Turbo C 2.0"
- X @echo " make bccswp - swapping DOS version with Borland C++ 2.0"
- X @echo " make msc40 - DOS with MSC 4.0"
- X @echo " make msc50 - DOS with MSC 5.0"
- X @echo " make msc51 - DOS with MSC 5.1"
- X @echo " make msc60 - DOS with MSC 6.0"
- X @echo " make msc40swp - swapping DOS version with MSC 4.0"
- X @echo " make msc50swp - swapping DOS version with MSC 5.0"
- X @echo " make msc51swp - swapping DOS version with MSC 5.1"
- X @echo " make msc60swp - swapping DOS version with MSC 6.0"
- X @echo " make ztc - DOS with Zortech C++ 2.1"
- X @echo " make ztcswp - swapping DOS version with Zortech C++ 2.1"
- X @echo " make mpwmac - Macintosh under MPW"
- X
- ultrix aix: sysvr3;
- X
- sysvr1 sysvr3 sysvr4 bsd43 386ix :; /bin/sh -x < unix/$@/make.sh
- X
- bsd43uw :; /bin/sh -x < unix/bsd43/uw/make.sh
- bsd43vf dynix mips :; /bin/sh -x < unix/bsd43/vf/make.sh
- coherent :; /bin/sh -x < unix/coherent/make.sh
- xenix :; /bin/sh -x < unix/xenix/make.sh
- xenixpwd :; /bin/sh -x < unix/xenix/pwd/make.sh
- sysvr3pwd :; /bin/sh -x < unix/sysvr3/pwd/make.sh
- tos :; sh -x tos/make.sh
- mpwmac :; :mac:make.sh
- X
- # Various OS/2 targets.
- OS2_VER = os2msc40 os2msc50 os2msc51 os2msc60
- $(OS2_VER) :; make.cmd $(@:s/os2//)
- X
- # DOS with some form of make and sh
- # Note if you do not have a 'make and/or sh' program under MSDOS then
- # typing 'make' in the dmake distribution directory will invoke the make.bat
- # batch file which will issue the appropriate instructions.
- DOS_VER = tcc msc40 msc50 msc51 msc60 \
- X tccswp msc40swp msc50swp msc51swp msc60swp \
- X bcc bccswp ztc ztcswp
- $(DOS_VER) :; make.bat $@
- SHAR_EOF
- chmod 0640 dmake/makefile ||
- echo 'restore of dmake/makefile failed'
- Wc_c="`wc -c < 'dmake/makefile'`"
- test 3491 -eq "$Wc_c" ||
- echo 'dmake/makefile: original size 3491, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/man/README ==============
- if test ! -d 'dmake/man'; then
- mkdir 'dmake/man'
- fi
- if test -f 'dmake/man/README' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/man/README (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/man/README' &&
- To unpack the DMAKE manual page please issue the following sequence of
- commands:
- X
- X uudecode dmake.uue
- X uncompress dmake.Z
- X mv dmake dmake.p
- X
- NOTE: You only need to do this if you cannot typeset the manual page
- X yourself.
- SHAR_EOF
- chmod 0640 dmake/man/README ||
- echo 'restore of dmake/man/README failed'
- Wc_c="`wc -c < 'dmake/man/README'`"
- test 228 -eq "$Wc_c" ||
- echo 'dmake/man/README: original size 228, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/man/dmake.nc ==============
- if test -f 'dmake/man/dmake.nc' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/man/dmake.nc (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/man/dmake.nc' &&
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- NAME
- X dmake - maintain program groups, or interdependent files
- X
- SYNOPSIS
- X dmake [-ABceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K}
- X file] [macro[*][+][:]=value ...] [target ...]
- X
- DESCRIPTION
- X dmake executes commands found in an external file called a
- X makefile to update one or more target names. Each target
- X may depend on zero or more prerequisite targets. If any of
- X the target's prerequisites is newer than the target or if
- X the target itself does not exist, then dmake will attempt to
- X make the target.
- X
- X If no -f command line option is present then dmake searches
- X for an existing makefile from the list of prerequisites
- X specified for the special target .MAKEFILES (see the STARTUP
- X section for more details). If "-" is the name of the file
- X specified to the -f flag then dmake uses standard input as
- X the source of the makefile text.
- X
- X Any macro definitions (arguments with embedded "=" signs)
- X that appear on the command line are processed first and
- X supersede definitions for macros of the same name found
- X within the makefile. In general it is impossible for defin-
- X itions found inside the makefile to redefine a macro defined
- X on the command line, see the MACROS section for an excep-
- X tion.
- X
- X If no target names are specified on the command line, then
- X dmake uses the first non-special target found in the
- X makefile as the default target. See the SPECIAL TARGETS
- X section for the list of special targets and their function.
- X dmake is a re-implementation of the UNIX Make utility with
- X significant enhancements. Makefiles written for most previ-
- X ous versions of Make will be handled correctly by dmake.
- X Known differences between dmake and other versions of make
- X are discussed in the COMPATIBILITY section found at the end
- X of this document.
- X
- OPTIONS
- X -A Enable AUGMAKE special inference rule transformations
- X (see the "PERCENT(%) RULES" section), these are set to
- X off by default.
- X
- X -B Enable the use of spaces instead of <tabs> to begin
- X recipe lines. This flag equivalent to the .NOTABS spe-
- X cial macro and is further described below.
- X
- X -c Use non-standard comment stripping. If you specify -c
- X then dmake will treat any # character as a start of
- X
- X
- X
- Version 3.70 UW 1
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X comment character wherever it may appear unless it is
- X escaped by a \.
- X
- X -C [+]file
- X This option writes to file a copy of standard output
- X and standard error from any child processes and from
- X the dmake process itself. If you specify a + prior to
- X the file name then the text is appended to the previous
- X contents of file. This option is active in the MSDOS
- X implementation only and is ignored by non-MSDOS ver-
- X sions of dmake.
- X
- X -E Read the environment and define all strings of the form
- X 'ENV-VAR=evalue' defined within as macros whose name is
- X ENV-VAR, and whose value is 'evalue'. The environment
- X is processed prior to processing the user specified
- X makefile thereby allowing definitions in the makefile
- X to override definitions in the environment.
- X
- X -e Same as -E, except that the environment is processed
- X after the user specified makefile has been processed
- X (thus definitions in the environment override defini-
- X tions in the makefile). The -e and -E options are
- X mutually exclusive. If both are given the latter takes
- X effect.
- X
- X -f file
- X Use file as the source for the makefile text. Only one
- X -f option is allowed.
- X
- X -h Print the command summary for dmake.
- X
- X -i Tells dmake to ignore errors, and continue making other
- X targets. This is equivalent to the .IGNORE attribute
- X or macro.
- X
- X -K file
- X Turns on .KEEP_STATE state tracking and tells dmake to
- X use file as the state file.
- X
- X -k Causes dmake to ignore errors caused by command execu-
- SHAR_EOF
- true || echo 'restore of dmake/man/dmake.nc failed'
- fi
- echo 'End of part 13, continue with part 14'
- echo 14 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
-